﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BusinessManagement
{
    /// <summary>
    /// Represent a user's session,with timeout informations, token information and a proxy on some properties.
    /// </summary>
    public class Session
    {
        /// <summary>
        /// Creates a new session with timeout initialization.
        /// </summary>
        public Session()
        {
            CreationTime = DateTime.Now.Ticks;
            LastActivity = CreationTime;
        }
        /// <summary>
        /// The timestamp of the entities creation.
        /// </summary>
        public long CreationTime { get; set; }
        /// <summary>
        /// The timestamp of the last use ofthis entity, used to determine timeout.
        /// </summary>
        public long LastActivity { get; set; }
        /// <summary>
        /// The token associated to this session.
        /// </summary>
        public string Token { get; set; }
        /// <summary>
        /// The login of the user corresponding to this session.
        /// </summary>
        public string Login { get; set; }

        /// <summary>
        /// The ID of the player's city.
        /// </summary>
        public int CityId { get; set; }
        /// <summary>
        /// The ID of the player's army.
        /// </summary>
        public int ArmyId { get; set; }
        /// <summary>
        /// The race name of the player.
        /// </summary>
        public string Race { get; set; }
    }
}
